Simple and Effective Type Check Removal through Lazy Basic Block Versioning

نویسندگان

  • Maxime Chevalier-Boisvert
  • Marc Feeley
چکیده

Dynamically typed programming languages such as JavaScript and Python defer type checking to run time. In order to maximize performance, dynamic language VM implementations must attempt to eliminate redundant dynamic type checks. However, type inference analyses are often costly and involve tradeoffs between compilation time and resulting precision. This has lead to the creation of increasingly complex multi-tiered VM architectures. This paper introduces lazy basic block versioning, a simple JIT compilation technique which effectively removes redundant type checks from critical code paths. This novel approach lazily generates type-specialized versions of basic blocks on-the-fly while propagating context-dependent type information. This does not require the use of costly program analyses, is not restricted by the precision limitations of traditional type analyses and avoids the implementation complexity of speculative optimization techniques. We have implemented intraprocedural lazy basic block versioning in a JavaScript JIT compiler. This approach is compared with a classical flow-based type analysis. Lazy basic block versioning performs as well or better on all benchmarks. On average, 71% of type tests are eliminated, yielding speedups of up to 50%. We also show that our implementation generates more efficient machine code than TraceMonkey, a tracing JIT compiler for JavaScript, on several benchmarks. The combination of implementation simplicity, low algorithmic complexity and good run time performance makes basic block versioning attractive for baseline JIT compilers. 1998 ACM Subject Classification D.3.4 [Programming Languages] Processors – Compilers, Optimization, Code Generation, Run-time Environments

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Type Check Removal Using Lazy Interprocedural Code Versioning

Dynamically typed languages use runtime type checks to ensure safety. These checks are known to be a cause of performance issues. Several strategies are used to remove type checks but are expensive in a JIT compilation context or limited in the absence of code duplication. This paper presents an interprocedural approach based on Basic Block Versioning that allows the removal of many type checks...

متن کامل

Interprocedural Type Specialization of JavaScript Programs Without Type Analysis

Previous work proposed lazy basic block versioning, a technique for just-in-time compilation of dynamic languages which we believe represents an interesting point in the design space. Basic block versioning is simple to implement, simple enough that a single developer can build a complete just-in-time compiler for JavaScript in a year, yet it performs surprisingly well as it propagates context-...

متن کامل

Removing Dynamic Type Tests with Context-Driven Basic Block Versioning

Dynamic typing is an important feature of dynamic programming languages. Primitive operators such as those for performing arithmetic and comparisons typically operate on a wide variety of input value types, and as such, must internally implement some form of dynamic type dispatch and type checking. Removing such type tests is important for an efficient implementation. In this paper, we examine ...

متن کامل

Database States in Lazy Functional Programming Languages: Imperative Update and Lazy Retrieval

This paper proposes a database manipulation interface for the statically typed, purely functional programming language Haskell. The data model uses surrogates to permit direct update of stored objects, and the basic interface is designed based on the state-transformer approach, so that the interface is referentially transparent. This approach requires all the operations to be executed in a sing...

متن کامل

Design and Implementation of a Distributed Versioning System

DVS is a simple versioning system that adopts a check-in/check-out policy with exclusive locks much like the one implemented by RCS. In addition to the basic functionalities of RCS, DVS provides extensions in two main directions: distribution of artifacts and versioning of collections of artifacts. DVS has been implemented on top of NUCM 2, a generic distributed platform aimed at providing a po...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2015